package com.gitee.wsl.transform.escape.sample

import com.gitee.wsl.transform.escape.Escape
import com.gitee.wsl.transform.escape.EscapeString
import com.gitee.wsl.text.replacer.NumericEntityDecoder
import com.gitee.wsl.text.replacer.NumericEntityEncoder
import com.gitee.wsl.text.replacer.AbstractStrReplacer

open class NumbericEscapeString(
    override val strReplacer: AbstractStrReplacer,
    override val strUnWarpReplacer: AbstractStrReplacer = NumericEntityDecoder.INSTANCE
): EscapeString()

fun Escape.Companion.numberic(encoder: NumericEntityEncoder, strUnWarpReplacer: AbstractStrReplacer = NumericEntityDecoder.INSTANCE) = NumbericEscapeString(encoder,strUnWarpReplacer)

val CTRLNumberEncoder = listOf(
    NumericEntityEncoder.between(0x1, 0x8),
    NumericEntityEncoder.between(0xe, 0x1f),
    NumericEntityEncoder.between(0x7f, 0x84),
    NumericEntityEncoder.between(0x86, 0x9f)
)